#pragma once

ref class CustomUIElementInfo
{
public:
	UINT id;
	System::String ^name;
	bool isPredefined;
	bool enabled;
	bool checked;
	System::Object ^value;
	System::Xml::XPath::XPathNavigator ^xml;
	CMFCRibbonBaseElement * element;
};

// CMyRibbonBar

class CMyRibbonBar : public CMFCRibbonBar
{
	DECLARE_DYNAMIC(CMyRibbonBar)
	CMFCToolBarImages				m_PanelImages;
	CMFCRibbonApplicationButton		m_MainButton;
	
	CMFCToolBarImages				m_customLargeImages;
	CMFCToolBarImages				m_customSmallImages;
	
	CList<COLORREF,COLORREF> m_lstMainColors;
	CList<COLORREF,COLORREF> m_lstAdditionalColors;
	CList<COLORREF,COLORREF> m_lstStandardColors;
	

public:
	CMyRibbonBar();
	virtual ~CMyRibbonBar();

	gcroot<System::Collections::Generic::IDictionary<UINT,CustomUIElementInfo ^> ^> m_clrCustomRibbonIDDictionary;
	gcroot<System::Collections::Generic::IDictionary<System::String ^,CustomUIElementInfo ^> ^> m_clrCustomRibbonNameDictionary;
	UINT ImportContextCategories(System::Xml::XPath::XPathNavigator ^xml, System::String ^externalRefDir);

protected:
	DECLARE_MESSAGE_MAP()
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

	void InitAdvancedCategory();
	void InitMessagesCategory();
	void InitHomeCategory();
	BOOL InitMainCategory();

	void InitFormatCategory( UINT id );

	void AddMessageFormatGroup( CMFCRibbonCategory * category );
	void AddActionsGroup( CMFCRibbonCategory * category );
	void AddEditingGroup( CMFCRibbonCategory * category );
	void AddParagraphGroup( CMFCRibbonCategory * category );
	void AddFontGroup( CMFCRibbonCategory * category );
	CMFCRibbonPanel * AddClipboardGroup(CMFCRibbonCategory * category );
	void CreateDocumentColors();
	CMFCRibbonBaseElement * CreateCustomElement(System::Xml::XPath::XPathNavigator ^ elementXml, bool toolbarMode, System::String ^externalRefDir);
	CMFCRibbonBaseElement * CreatePredefinedElement(System::String ^ name, bool toolbarMode);

};


